<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of EventCategories
 *
 * @author NguyenVanTien
 */
class Application_Model_DbTable_EventCategories extends Zend_Db_Table_Abstract {
    
    protected $_name = 'event_categories';
    protected $_primary = 'event_category_id';
    
    /**
     * Get list event categories
     * @author Tien Nguyen
     * @return type 
     */
    public function listEventCategories(){
        $select = $this->select()
                ->from('event_categories');
        return $this->fetchAll($select);
    }
    
    public function convertFiledObject (&$list){
        foreach($list as $key => $item){
            $list[$key]['eventCategoryId'] = $item['event_category_id'];
            $list[$key]['eventCategoryName'] = $item['event_category_name'];
        }
    }
    
    public function convertFieldObjectItem(&$array){
        $array['eventCategoryId'] = $array['event_category_id'];
        $array['eventCategoryName'] = $array['event_category_name'];
    }
    
}

?>
